Ok(Unit {
pkg: pkg,
target: t,
- profile: self.lib_profile(id),
+ profile: self.lib_profile(),
kind: unit.kind.for_target(t),
})
})
Unit {
pkg: unit.pkg,
target: t,
- profile: self.lib_profile(id),
+ profile: self.lib_profile(),
kind: unit.kind.for_target(t),
}
}));
ret.push(Unit {
pkg: dep,
target: lib,
- profile: self.lib_profile(dep.package_id()),
+ profile: self.lib_profile(),
kind: unit.kind.for_target(lib),
});
if self.build_config.doc_all {
Unit {
pkg: unit.pkg,
target: t,
- profile: self.lib_profile(unit.pkg.package_id()),
+ profile: self.lib_profile(),
kind: unit.kind.for_target(t),
}
})
/// Number of jobs specified for this build
pub fn jobs(&self) -> u32 { self.build_config.jobs }
- pub fn lib_profile(&self, _pkg: &PackageId) -> &'a Profile {
+ pub fn lib_profile(&self) -> &'a Profile {
let (normal, test) = if self.build_config.release {
(&self.profiles.release, &self.profiles.bench_deps)
} else {
}
}
- pub fn build_script_profile(&self, pkg: &PackageId) -> &'a Profile {
+ pub fn build_script_profile(&self, _pkg: &PackageId) -> &'a Profile {
// TODO: should build scripts always be built with the same library
// profile? How is this controlled at the CLI layer?
- self.lib_profile(pkg)
+ self.lib_profile()
}
pub fn rustflags_args(&self, unit: &Unit) -> CargoResult<Vec<String>> {
// environment variables. Note that the profile-related environment
// variables are not set with this the build script's profile but rather the
// package's library profile.
- let profile = cx.lib_profile(unit.pkg.package_id());
+ let profile = cx.lib_profile();
let to_exec = to_exec.into_os_string();
let mut cmd = cx.compilation.host_process(to_exec, unit.pkg)?;
cmd.env("OUT_DIR", &build_output)
}
let build_type = if self.is_release { "release" } else { "debug" };
- let profile = cx.ws.current_opt().map_or_else(Profile::default, |p| {
- cx.lib_profile(p.package_id()).to_owned()
- });
+ let profile = cx.lib_profile();
let mut opt_type = String::from(if profile.opt_level == "0" { "unoptimized" }
else { "optimized" });
if profile.debuginfo {